1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to a file system and, more particularly, to reducing the time required to search for files in a file system.
2. Description of Related Art
Generally, an operating system (OS) uses a file system to manage the data existing on the system in which the operating system is installed. The file system is a logical structure that should be configured to manage files. For example, in the case of Microsof™ Windows™, a format command is a process of creating and initializing the file system. As such, after the file system has been created, a user can store or delete files.
Various types of file systems, such as the file allocation table (FAT) and the new technology file system (NTFS) of the Windows™ operating system, the Unix™ file system (UFS), the extended 2 (EXT2), the extended 3 (EXT3), and the journaled file system (JFS) of the
Unix™/Linux™ operating systems, exist. These file systems provide various additional functions, such as data encryption and data compression.
In the related art, file systems have two storage areas. One is a data area where actual file data is stored, and the other is an information area where file information is stored. Attributes, rights, name, and position of the file are stored in the information area. A more detailed description will follow with reference to FIG. 1.
FIG. 1 is a diagram illustrating the schematic configuration of FAT file systems (such as FAT 12, FAT 16, FAT 32). As illustrated, a file system 5 includes information areas 1, 2, 3 where file information is stored, and a data area 4 where actual file data is stored.
The information areas 1, 2, 3 include a master boot record (MBR) area 1, a FAT area 2, and a directory entry area 3.
The MBR area 1 is common to all operating systems, and is generally located at the top of a physical storage medium such as a hard disk. The MBR area 1 includes information on partitions and execution codes related to booting.
The directory entry area 3 stores the position information of a first cluster where the attributes, rights, name, and position of the file are stored.
The FAT area 2 stores position information related to files. Specifically, when the actual data of the file is distributed and stored in a plurality of clusters, the FAT area 2 stores the position of the cluster where the position information of each cluster and the last data of the file are stored.
One or more files on the FAT file system are read through the following steps. First, a first cluster number of the corresponding file name is read from the directory entry area 3 through a file name and an extension. Then, the data dispersed in the data area 4 is read from position information recorded in the FAT area 2 through the first cluster number by connecting clusters where specified data is stored.
In contrast, in a process of storing files in the file system, first, information of the files to be stored is stored in the information area. At this time, the file size and first cluster number is stored in the directory entry area 3, and the position information of data is stored in the FAT area 2. Next, actual data of the file is stored in the data area 4. In file systems other than the FAT file system, files are divided and their data is stored in the information area and the data area.
As described above, when files are managed in the related art file system, the director entry area 3 must be searched first. For example, when new file is to be stored, the directory entry area 3 should be searched in order to determine whether the file name is identical to another file name, and then the file is stored depending on the result.
Additionally, as the related art file system searches for the directory entry area 3 throughout the file storage/retrieval process, the retrieval speed and file management performance may be lower.
Therefore, a technology that can improve the file retrieval speed in a file system is desired.